from django.shortcuts import render, HttpResponse, HttpResponsePermanentRedirect
from django.urls import reverse

# Create your views here.
def index(request):
    return HttpResponse('成功跳转到被反向解析的地方')

def index_page(request, page):
    return HttpResponse(f'成功跳转到被反向解析的地方, 参数是{page}')

def redirect_to_index(request):
    print('='*40)
    print(reverse('ind'))
    print(reverse('in_page', args=(100,)))
    print('='*40)
    return HttpResponsePermanentRedirect(reverse('ind'))

def html_index(request):
    return render(request, 'index.html')